$(document).ready(function () {


  var myFullpage = new fullpage('#dowebok', {
    licenseKey: 'OPEN-SOURCE-GPLV3-LICENSE',
    lockAnchors: false,
    anchors: ['page1', 'page2', 'page3', 'page4', 'page5', 'page6'],
    navigation: false,
    menu: '#menu',
    navigationPosition: 'right',
    navigationTooltips: ['首页', '我们', '生态', '技术', '商城', '联系'],
    showActiveTooltip: false,
    slidesNavigation: false,
    slidesNavPosition: 'bottom',
    css3: true,
    scrollingSpeed: 700,
    autoScrolling: true,
    fitToSection: true,
    fitToSectionDelay: 1000,
    scrollBar: false,
    easing: 'easeInOutCubic',
    easingcss3: 'ease',
    loopBottom: false,
    loopTop: false,
    loopHorizontal: true,
    continuousVertical: false,
    continuousHorizontal: false,
    scrollHorizontally: false,
    interlockedSlides: false,
    dragAndMove: false,
    offsetSections: false,
    resetSliders: false,
    fadingEffect: false,
    normalScrollElements: '#element1, .element2',
    scrollOverflow: false,
    scrollOverflowReset: false,
    scrollOverflowOptions: null,
    touchSensitivity: 15,
    normalScrollElementTouchThreshold: 5,
    bigSectionsDestination: null,
    keyboardScrolling: true,
    animateAnchor: true,
    recordHistory: true,
    controlArrows: true,
    verticalCentered: true,
    sectionsColor : ['#e2f0f1','#e9f7ef', '#ebffe47a','#d7ffed7a', '#ededed', '#FFF'],
    paddingTop: '3em',
    paddingBottom: '10px',
    fixedElements: '#header, .footer',
    responsiveWidth: 0,
    responsiveHeight: 0,
    responsiveSlides: false,
    parallax: false,
    parallaxOptions: {type: 'reveal', percentage: 62, property: 'translate'},
    sectionSelector: '.section',
    slideSelector: '.slide',
    lazyLoading: true,
    //事件
    onLeave: function (origin, destination, direction) {
          if(origin.index == 0){
            $('.section-1').find('.section-home').animate({top:"30%",left:"-10%"}, 80);
            $('.section-1').find('.home-text').animate({top:"25%",right:"0"}, 80);
          }
          if(origin.index == 1){
            $('.section-2').find('.section-home').animate({top:"30%",left:"-10%"}, 80);
            $('.section-2').find('.home-text').animate({top:"25%",right:"0"}, 80);
          }
          if(origin.index == 2){
            $('.section-3').find('.section-home').animate({top:"30%",left:"-10%"}, 80);
            $('.section-3').find('.home-text').animate({top:"25%",right:"0"}, 80);
          }
          if(origin.index == 3){
            $('.section-4').find('.section-shop').animate({opacity:"0.1"}, 80);
            $('.section-4').find('.text-shop').animate({top:"20%",right:"10%"}, 80);
          }
          if(origin.index == 4){
            $('.section-5').find('.section-home').animate({top:"30%",left:"-10%"}, 80);
            $('.section-5').find('.home-text').animate({top:"25%",right:"0"}, 80);
          }
          if(origin.index == 5){
            $('.section-6').find('.section-home').animate({top:"30%",left:"-10%"}, 80);
            $('.section-6').find('.home-text').animate({top:"25%",right:"0"}, 80);
          }
    },
    afterLoad: function (origin, destination, direction) {
          if(destination.index == 0){
            $('.section-1').find('.section-home').animate({top:"30%",left:"3%"}, 1000);
            $('.section-1').find('.home-text').animate({top:"32%",right:"10%"}, 1000);
          }
          if(destination.index == 1){
            $('.section-2').find('.section-home').animate({top:"30%",left:"3%"}, 1000);
            $('.section-2').find('.home-text').animate({top:"32%",right:"10%"}, 1000);
          }
          if(destination.index == 2){
            $('.section-3').find('.section-home').animate({top:"30%",left:"3%"}, 1000);
            $('.section-3').find('.home-text').animate({top:"32%",right:"10%"}, 1000);
          }
          if(destination.index == 3){
            $('.section-4').find('.section-shop').animate({opacity:"0.9"}, 1000);
            $('.section-4').find('.text-shop').animate({top:"32%",right:"10%"}, 1000);
          }
          if(destination.index == 4){
            $('.section-5').find('.section-home').animate({top:"30%",left:"3%"}, 1000);
            $('.section-5').find('.home-text').animate({top:"32%",right:"10%"}, 1000);
          }
          if(destination.index == 5){
            $('.section-6').find('.section-home').animate({top:"30%",left:"3%"}, 1000);
            $('.section-6').find('.home-text').animate({top:"32%",right:"10%"}, 1000);
          }
    },
    afterRender: function () {},
    afterResize: function (width, height) {},
    afterResponsive: function (isResponsive) {},
    afterSlideLoad: function (section, origin, destination, direction) {},
    onSlideLeave: function (section, origin, destination, direction) {}
  });
})
